import { createRouter, createWebHistory } from 'vue-router';

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/manage',
      name: 'Manage',
      component: () => import('@/views/Manager.vue'),
      children: [
        { path: '/homeManage', name: 'HomeManage', component: () => import('@/views/backPanel/Home.vue') },
        { path: '/courseManage', name: 'CourseManage', component: ()=>import('@/views/backPanel/Course.vue')},
        { path: '/studentIfoManage', name: 'StudentIfoManege', component: () => import('@/views/backPanel/StudentIfo.vue') },
        { path: '/selectCourseManage', name: 'SelectCourseManage', component: () => import('@/views/backPanel/SelectCourse.vue') },
        { path: '/articleManage', name: 'ArticleManage', component: () => import('@/views/backPanel/Article.vue') },
        { path: '/noticeManage', name: 'NoticeManage', component: () => import('@/views/backPanel/Notice.vue') },
      ]
    },
    {
      path: '/login',
      name: 'Login',
      component: () => import('@/views/Login.vue'),
    },
    {
      path: '/admin',
      name: 'Admin',
      component: () => import('@/views/Admin.vue'),
    },
    {
      path: '/register',
      name: 'Register',
      component: () => import('@/views/Register.vue'),
    },
    {
      path: '/',
      name: 'Front',
      component: () => import('@/views/Front.vue'),
      redirect:'/login',
      children: [
        { path: '/homeFront', name: 'HomeFront', component: () => import('@/views/frontPanel/Home.vue') },
        { path: '/courseFront', name: 'CourseFront', component: ()=>import('@/views/frontPanel/Course.vue')},
        { path: '/personIfoFront', name: 'PersonIfoFront', component: () => import('@/views/frontPanel/PersonIfo.vue') },
        { path: '/selectCourseFront', name: 'SelectCourseFront', component: () => import('@/views/frontPanel/SelectCourse.vue') },
        { path: '/articleFront', name: 'ArticleFront', component: () => import('@/views/frontPanel/Article.vue') },
      ]
    },
  ]
});

export default router;
